Table of Contents
Basic Architecture
Registers
Stack
Relative Memory Reference
Memory layout and IO
Memory Protection
Clock IO
Flag IO
Data Received
Data Received Size
Data Sent
Data Sent Size
Shared Memory
NVRAM Memory
Interrupt Pointers
Processor Identification
Interrupts and Exceptions
Timer 1 to 4 Interrupts
Invalid Instruction Exception
Divide by 0 Exception
Memory Exception
Data Received Interrupt
Data Sent Interrupt
Exceptions
Instruction Set
AD - ADD
ADC - ADD WITH CARRY
ADCI - ADD IMMEDIATE WITH CARRY
ADCIM - ADD IMMEDIATE MULTI REG WITH CARRY
ADCM - ADD MULTI REG WITH CARRY
ADF - ADD FLOATING POINT
ADFM - ADD FLOATING POINT MULTI REG
ADI - ADD IMMEDIATE
ADIM - ADD IMMEDIATE MULTI REG
ADM - ADD MULTI REG
AN - AND
ANI - AND IMMEDIATE
ANM - AND MULTI REG
B - BRANCH CONDITIONAL
BF - BIT FLIP
BFM - BIT FLIP MULTI REG
BR - BRANCH REGISTER CONDITIONAL
BRA - BRANCH ABSOLUTE
BRR - BRANCH RELATIVE
C - CALL CONDITIONAL
CAA - CALL ABSOLUTE
CAR - CALL RELATIVE
CM - COMPARE
CMF - COMPARE FLOATING POINT
CMFM - COMPARE FLOATING POINT MULTI REG
CMI - COMPARE IMMEDIATE
CMIM - COMPARE IMMEDIATE MULTI REG
CMM - COMPARE MULTI REG
CR - CALL REGISTER CONDITIONAL
DBRK - DEBUG BREAK
DI - DISABLE INTERRUPTS
DMT - DIRECT MEMORY TRANSFER
DV - DIVIDE
DVF - DIVIDE FLOATING POINT
DVFM - DIVIDE FLOATING POINT MULTI REG
DVI - DIVIDE IMMEDIATE
DVIM - DIVIDE IMMEDIATE MULTI REG
DVIS - DIVIDE IMMEDIATE SIGNED
DVISM - DIVIDE IMMEDIATE SIGNED MULTI REG
DVM - DIVIDE MULTI REG
DVS - DIVIDE SIGNED
DVSM - DIVIDE SIGNED MULTI REG
EI - ENABLE INTERRUPTS
FTI - FLOAT TO INTEGER
FTIM - FLOAT TO INTEGER MULTI REG
HT - HALT
IR - INTERRUPT RETURN
ITF - INTEGER TO FLOAT
ITFM - INTEGER TO FLOAT MULTI REG
LDS - LOAD SINGLE
LDT - LOAD TRI
LDW - LOAD WORD
MD - MODULUS
MDF - MODULUS FLOATING POINT
MDFM - MODULUS FLOATING POINT MULTI REG
MDI - MODULUS IMMEDIATE
MDIM - MODULUS IMMEDIATE MULTI REG
MDIS - MODULUS IMMEDIATE SIGNED
MDISM - MODULUS IMMEDIATE SIGNED MULTI REG
MDM - MODULUS MULTI REG
MDS - MODULUS SIGNED
MDSM - MODULUS SIGNED MULTI REG
MH - MOVE HIGH
ML - MOVE LOW
MS - MOVE LOW SIGNED
MU - MULTIPLY
MUF - MULTIPLY FLOATING POINT
MUFM - MULTIPLY FLOATING POINT MULTI REG
MUI - MULTIPLY IMMEDIATE
MUIM - MULTIPLY IMMEDIATE MULTI REG
MUIS - MULTIPLY IMMEDIATE SIGNED
MUISM - MULTIPLY IMMEDIATE SIGNED MULTI REG
MUM - MULTIPLY MULTI REG
MUS - MULTIPLY SIGNED
MUSM - MULTIPLY SIGNED MULTI REG
NG - NEGATE
NGF - NEGATE FLOATING POINT
NGFM - NEGATE FLOATING POINT MULTI REG
NGM - NEGATE MULTI REG
NT - NOT
NTM - NOT MULTI REG
OR - OR
ORI - OR IMMEDIATE
ORM - OR MULTI REG
RE - RETURN
RF - READ FLAGS
RL - ROTATE LEFT
RLI - ROTATE LEFT IMMEDIATE
RLIM - ROTATE LEFT IMMEDIATE MULTI REG
RLM - ROTATE LEFT MULTI REG
RMP - READ MEMORY PROTECTION
RND - RANDOM
RNDM - RANDOM MULTI REG
RR - ROTATE RIGHT
RRI - ROTATE RIGHT IMMEDIATE
RRIM - ROTATE RIGHT IMMEDIATE MULTI REG
RRM - ROTATE RIGHT MULTI REG
SA - SHIFT ARITHEMETIC RIGHT
SAI - SHIFT ARITHEMETIC RIGHT IMMEDIATE
SAIM - SHIFT ARITHEMETIC RIGHT IMMEDIATE MULTI REG
SAM - SHIFT ARITHEMETIC RIGHT MULTI REG
SB - SUBTRACT
SBC - SUBTRACT WITH CARRY
SBCI - SUBTRACT IMMEDIATE WITH CARRY
SBCIM - SUBTRACT IMMEDIATE MULTI REG WITH CARRY
SBCM - SUBTRACT MULTI REG WITH CARRY
SBF - SUBTRACT FLOATING POINT
SBFM - SUBTRACT FLOATING POINT MULTI REG
SBI - SUBTRACT IMMEDIATE
SBIM - SUBTRACT IMMEDIATE MULTI REG
SBM - SUBTRACT MULTI REG
SES - SIGN EXTEND SINGLE
SEW - SIGN EXTEND WORD
SF - SET FLAGS
SL - SHIFT LEFT
SLI - SHIFT LEFT IMMEDIATE
SLIM - SHIFT LEFT IMMEDIATE MULTI REG
SLM - SHIFT LEFT MULTI REG
SMP - SET MEMORY PROTECTION
SR - SHIFT RIGHT
SRI - SHIFT RIGHT IMMEDIATE
SRIM - SHIFT RIGHT IMMEDIATE MULTI REG
SRM - SHIFT RIGHT MULTI REG
STS - STORE SINGLE
STT - STORE TRI
STW - STORE WORD
WT - WAIT
XR - XOR
XRI - XOR IMMEDIATE
XRM - XOR MULTI REG
ZES - ZERO EXTEND SINGLE
ZEW - ZERO EXTEND WORD
Basic Architecture
cLEMENCy is the LEgitbs Middle ENdian Computer architecture developed by Lightning for DEF CON CTF.

Each byte is 9 bits of data, bit 0 is the left most significant bit. Middle-Endian data stores bits 9 to 17, followed by bits 0 to 8, then bits 18 to 27 in memory when handling three bytes. Two bytes of data will have bits 9-17 then bits 0 to 8 written to memory.

Register XXYYZZ → Memory YYXXZZ

Register XXYY → Memory YYXX

Registers
cLEMECy has 32 general purpose 27-bit wide registers that serve both floating point and integer math operations along with a separate flag register. The multi-register format allows for a 54-bit value to be used during math operations by using two registers side by side while the starting register can be any register. If an instruction goes past the PC register while accessing multiple registers then access continues to R0. Attempts to write to PC by a load instruction are ignored.

The multi-register format and floating point operations are optional components of the processor, checking the processor features is recommended before attempts are made in using such instructions.

The ST, RA, and PC registers have a special purpose while all other registers are general use. The following table is a recommended register setup for compilers:

Register NameRegister NumberNotes
R00General purpose, parameter 1 and function return value
R1 to R81 to 8General purpose, parameters 2 to 8
R9 to R289 to 28General purpose, saved between function calls
ST29Pointer into the current memory location holding the current end of the stack
RA30Return address register, filled in by the call instruction, used when a return is executed
PC31Program counter, register is read-only
FLCurrent flag and interrupt state

The flags register has the following layout:
00000000000000XXXXXXXXXSOCZ
Zero bit
Carry bit
Overflow bit
Signed bit
Timer1 Interrupt Enabled
Timer2 Interrupt Enabled
Timer3 Interrupt Enabled
Timer4 Interrupt Enabled
Invalid Instruction Exception Enabled
Divide by 0 Exception Enabled
Memory Exception Enabled
Data Received Interrupt Enabled
Data Sent Interrupt Enabled

Stack
Due to no specific stack based instructions, there is no expected direction the stack should grow, however during an interrupt the processor will subtract 99 bytes of data from the stack pointer when storing all registers to the stack and the interrupt return will read 99 bytes from the current stack pointer. If an implementation needs the interrupts to add to the stack instead of subtracting then changing the 'Interrupt stack direction flag' bit in the features area of the processor will accomplish this.

Relative Memory Reference
All relative references are from the beginning of the instruction handling the relative reference. A relative branch will adjust PC by the amount in the relative offset without including the branch instruction size. Only if the branch is not taken is PC adjusted by the instruction size.

Memory layout and IO
There are 2 main areas of memory, the RAM area and the DMA mapped areas. Processor execution starts at memory offset 0 and all DMA memory has the high bit of the memory address set. The following table provides the memory mapping for cLEMENCy processors:

Memory StartMemory EndInformation
00000003FFFFFFMain Program Memory
4000000400001DClock IO
40100004010FFFFlag IO
50000005001FFFData Received
50020005002002Data Received Size
50100005011FFFData Sent
50120005012002Data Sent Size
600000067FFFFFShared Memory
68000006FFFFFFNVRAM Memory
7FFFF007FFFF1BInterrupt Pointers
7FFFF807FFFFFFProcessor Identification and Features

Memory Protection
Memory is broken up into 1024 byte pages. Each page can have 1 of 4 states applied to it.

StateMeaning
0No Access
1Read Only
2Read/Write
3Read/Execute

Attempting to interact with memory that is inconsistent with its current state will result in a memory exception occurring. If the exception is turned off and the attempt is execution then the processor will halt. The memory protection flags are from the processor only allowing for external IO controllers to modify any memory they are associated with even if the memory protection flags are set on their regions to Read Only or No Access.

Clock IO
There are 6 bytes per timer with 4 timers maximum. A 0 for the timer delay disables that specific timer. Each timer has a 1 millisecond accuracy.

Memory StartBytesDetails
40000003Timer 1 Delay
40000033Number of milliseconds left for Timer 1
40000063Timer 2 Delay
40000093Number of milliseconds left for Timer 2
400000C3Timer 3 Delay
400000F3Number of milliseconds left for Timer 3
40000123Timer 4 Delay
40000153Number of milliseconds left for Timer 4
40000186Number of seconds since Aug. 02, 2013 09:00 PST
400001E3Number of processing ticks since processor start

Flag IO
This memory area contains the flag of the current instance of the running firmware. Its default is readable and writable however writes are ignored. The processor enforces a minimum readable setting.

Data Received
When the Data Received interrupt fires, this area has been filled in with network related traffic. No more data can be received until the value stored in the Data Received Size area is set to 0.

Data Received Size
This area ia a 3 byte value storing the size of data received. If this value is non-zero then no more data can be received from the network.

Data Sent
This area is a buffer to write data to that is to be sent over the network. The data is not sent until the Data Sent Size value is specified.

Data Sent Size
This area is a 3 byte value storing the size of data being sent. When a value is written to this memory location the amount of data specified will be sent over the network. Upon completion the value is set to 0 and the Data Sent interrupt is fired to indicate success.

Shared Memory
This area of memory is an optional component that allows a processor to have a shared memory region with other processors on the same bus. If this area is detected on initialization then it will be marked Read/Write. Care must be taken in communicating with other processors as data may be overwritten.

NVRAM Memory
This area of memory is an optional component that allows a processor to have storage between a full power cycle. If this area is detected on initialization then it will be marked Read/Write.

Interrupt Pointers
Each interrupt has 3 bytes to indicate the area of memory to jump to upon the interrupt firing. If the value is 0 then the interrupt is not fired. It is possible for an interrupt to fire while another interrupt is processing so disabling and enabling interrupts is highly recommended to avoid conflicts.

Memory StartInterrupt
7FFFF00Timer 1
7FFFF03Timer 2
7FFFF06Timer 3
7FFFF09Timer 4
7FFFF0CInvalid Instruction
7FFFF0FDivide by 0
7FFFF12Memory Exception
7FFFF15Data Received
7FFFF18Data Sent

Processor Identification
The last 128 bytes of memory are used for processor identification and information of supported functionality. Writes to this area are ignored with the exception of the Interrupt Stack Direction Flag.

Memory StartBytesDetails
7FFFF8020Processor name
7FFFFA03Processor version
7FFFFA33Processor functionality flags
7FFFFA64AFor future use
7FFFFF01Interrupt stack direction flag
7FFFFF1FFor future use

It is recommended to implementors that the processor version contains a Major, Minor, and Revision value, one value per byte entry.

The functionality flags has the following information:
0000000000000000000000000XX
Processor supports 54-bit math
FPU built into the processor
Interrupts are able to flip stack storage direction

The low bit of the interrupt stack direction flag dictates the direction the interrupt writes to the stack. A value of 0, the default, results in the interrupt subtracting 99 bytes from the stack pointer then storing all registers in the 99 byte buffer starting with register 0. A value of 1 results in the interrupt storing and incrementing the stack pointer starting with register 0. The interrupt return behaves in the opposite manner to restore the registers.

Interrupts and Exceptions
When any interrupt is fired, all 32 general purpose registers and low 4 bits of the flags register are stored to the current stack before the processor begins executing the specified interrupt routine. Upon returning from an interrupt, all registers and low bits of the flag register are restored from the stack. The Disable Interrupts, DI, and Enable Interrupts, EI, instructions are used to temporarily disable an interrupt. Any interrupt with a value of 0 will not be called and ignored.

Timer 1 to 4 Interrupts
Each timer has an accuracy of 1 millisecond and can be configured through the Clock IO.

Invalid Instruction Exception
When an invalid instruction is detected this interrupt is fired. If this interrupt is disabled with DI, (the "Disable Interrupts" instruction,) or by having this value be 0 then the processor will halt.

Divide by 0 Exception
Division with a divisor of 0 will trigger this interrupt. Additionally, all other floating point exceptions will also trigger this interrupt.

Memory Exception
An attempt to read, write, or execute memory with invalid permission bits will cause this interrupt to trigger.

Data Received Interrupt
When data is received over the network this interrupt is fired.

Data Sent Interrupt
When data is fully sent over the network this interrupt is fired.

Exceptions
Upon an exception occurring, all registers are moved to the stack, R0 is set to the PC location that failed, R1 is set to one of the following IDs indicating the type of exception, and R2 is a value specific to the exception type. If an exception occurs while the interrupt handling the exception is still active then the processor will halt.

ExceptionIDValue Meaning
Memory Read0Address that failed to be read
Memory Write1Address that failed to be written
Memory Execute2Address that failed to execute
Invalid Instruction30
Floating Point Error40
Divide By 050

If the exception is disabled or the interrupt has no registered handler then the exception is ignored and the result of the operation that failed is undefined. The only case this is problematic is upon an instruction fault or execution in non-executable memory. If no exception is registered it will cause the CPU to halt due to not advancing the PC which would otherwise cause an infinite fault loop. If multiple faults can occur on the same instruction then only one fault will occur although no guarantee of which fault takes priority.

Instruction Set
Unless specified otherwise, all math and immediate values are unsigned for integer arithmetic while all floating point math is signed. All rX values can reference a general purpose register from 0 to 31. Any time the format rX:rX+Y is seen, the instruction will work on registers rX through and including rX+Y based on the value of Y. If present, the UF field controls if the flags get updated for the instruction.

ADADD

06
711
1216
1721
2225
26
0000000rArBrC0000UF
Format: AD rA, rB, rC
Purpose: Add two 27-bit integer registers together
Description: The 27-bit value in rC is added to the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB + rC
Flags affected: Z C O S

ADCADD WITH CARRY

06
711
1216
1721
2225
26
0100000rArBrC0000UF
Format: ADC rA, rB, rC
Purpose: Add two 27-bit integer registers together including the carry bit
Description: The 27-bit value in rC is added to the 27-bit value in rB, the carry bit from any previous operation is added to the result. The result is placed in rA.
Operation: rA ← rB + rC + Carry_Bit
Flags affected: Z C O S

ADCIADD IMMEDIATE WITH CARRY

06
711
1216
1723
2425
26
0100000rArBImmediate01UF
Format: ADCI rA, rB, IMM
Purpose: Add a 7-bit immediate value to a 27-bit integer register including the carry bit
Description: The 7-bit immediate value is added to the 27-bit value in rB, the carry bit from any previous operation is added to the result. The result is placed in rA.
Operation: rA ← rB + IMM + Carry_Bit
Flags affected: Z C O S

ADCIMADD IMMEDIATE MULTI REG WITH CARRY

06
711
1216
1723
2425
26
0100010rArBImmediate01UF
Format: ADCIM rA, rB, IMM
Purpose: Add a 7-bit immediate value to a 54-bit integer register including the carry bit
Description: The 7-bit immediate value is added to the 54-bit value in rB:rB+1, the carry bit from any previous operation is added to the result. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 + IMM + Carry_Bit
Flags affected: Z C O S

ADCMADD MULTI REG WITH CARRY

06
711
1216
1721
2225
26
0100010rArBrC0000UF
Format: ADCM rA, rB, rC
Purpose: Add two 54-bit integer registers together including the carry bit
Description: The 54-bit value in rC:rC+1 is added to the 54-bit value in rB:rB+1, the carry bit from any previous operation is added to the result. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 + rC:rC+1 + Carry_Bit
Flags affected: Z C O S

ADFADD FLOATING POINT

06
711
1216
1721
2225
26
0000001rArBrC0000UF
Format: ADF rA, rB, rC
Purpose: Add two 27-bit floating point registers together
Description: The 27-bit floating point value in rC is added to the 27-bit floating point value in rB, the result is placed in rA.
Operation: rA ← rB + rC
Flags affected: Z C O S

ADFMADD FLOATING POINT MULTI REG

06
711
1216
1721
2225
26
0000011rArBrC0000UF
Format: ADFM rA, rB, rC
Purpose: Add two 54-bit floating point registers together
Description: The 54-bit floating point value in rC:rC+1 is added to the 54-bit floating point value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 + rC:rC+1
Flags affected: Z C O S

ADIADD IMMEDIATE

06
711
1216
1723
2425
26
0000000rArBImmediate01UF
Format: ADI rA, rB, IMM
Purpose: Add a 7-bit immediate value to a 27-bit integer register
Description: The 7-bit immediate value is added to the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB + IMM
Flags affected: Z C O S

ADIMADD IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
0000010rArBImmediate01UF
Format: ADIM rA, rB, IMM
Purpose: Add a 7-bit immediate value to a 54-bit integer register
Description: The 7-bit immediate value is added to the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 + IMM
Flags affected: Z C O S

ADMADD MULTI REG

06
711
1216
1721
2225
26
0000010rArBrC0000UF
Format: ADM rA, rB, rC
Purpose: Add two 54-bit integer registers together
Description: The 54-bit value in rC:rC+1 is added to the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 + rC:rC+1
Flags affected: Z C O S

ANAND

06
711
1216
1721
2225
26
0010100rArBrC0000UF
Format: AN rA, rB, rC
Purpose: Bit-wise AND two 27-bit integer registers together
Description: The 27-bit value in rC is bit-wise AND to the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB & rC
Flags affected: Z C O S

ANIAND IMMEDIATE

06
711
1216
1723
2425
26
0010100rArBImmediate01UF
Format: ANI rA, rB, IMM
Purpose: Bit-wise AND a 27-bit integer register and 7-bit immediate together
Description: The 7-bit immediate value is bit-wise AND to the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB & IMM
Flags affected: Z C O S

ANMAND MULTI REG

06
711
1216
1721
2225
26
0010110rArBrC0000UF
Format: ANM rA, rB, rC
Purpose: Bit-wise AND two 54-bit integer registers together
Description: The 54-bit value in rC:rC+1 is bit-wise AND to the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 & rC:rC+1
Flags affected: Z C O S

BBRANCH CONDITIONAL

05
69
1026
110000ConditionOffset
Format: Bcc Offset
Purpose: Conditional branch to an offset
Description: If the specified condition is true then the sign extended offset is added to the current program counter.
The condition table is as follows:
ccValueDescriptionFlag State Checked
n0000Not Equal / Not ZeroZ == 0
e0001Equal / ZeroZ == 1
l0010Less ThanC == 1 AND Z == 0
le0011Less Than or EqualC == 1 OR Z == 1
g0100Greater ThanC == 0 AND Z == 0
ge0101Greater Than or EqualC == 0 OR Z == 1
no0110Not OverflowO == 0
o0111OverflowO == 1
ns1000Not SignedS == 0
s1001SignedS == 1
sl1010Signed Less ThanS != O
sle1011Signed Less Than or EqualS != O OR Z == 1
sg1100Signed Greater ThanS == O AND Z == 0
sge1101Signed Greater Than or EqualS == O
1111Always
Operation:
if Flags == Condition then
    PC += (signed)Offset
Flags affected:

BFBIT FLIP

08
913
1418
1925
26
101001100rArB1000000UF
Format: BF rA, rB
Purpose: Bit flip a 27-bit register
Description: Invert all bits of the 27-bit rB register value and store the result in rA.
Operation: rA ← ~rB
Flags affected: Z C O S

BFMBIT FLIP MULTI REG

08
913
1418
1925
26
101001110rArB1000000UF
Format: BFM rA, rB
Purpose: Bit flip a 54-bit register
Description: Invert all bits of the 54-bit rB:rB+1 register value and store the result in rA:rA+1.
Operation: rA:rA+1 ← ~rB:rB+1
Flags affected: Z C O S

BRBRANCH REGISTER CONDITIONAL

05
69
1014
1517
110010ConditionrA000
Format: BRcc rA
Purpose: Conditional branch to a register
Description: If the specified condition is true then the value in rA is placed into the program counter.
The condition table is as follows:
ccValueDescriptionFlag State Checked
n0000Not Equal / Not ZeroZ == 0
e0001Equal / ZeroZ == 1
l0010Less ThanC == 1 AND Z == 0
le0011Less Than or EqualC == 1 OR Z == 1
g0100Greater ThanC == 0 AND Z == 0
ge0101Greater Than or EqualC == 0 OR Z == 1
no0110Not OverflowO == 0
o0111OverflowO == 1
ns1000Not SignedS == 0
s1001SignedS == 1
sl1010Signed Less ThanS != O
sle1011Signed Less Than or EqualS != O OR Z == 1
sg1100Signed Greater ThanS == O AND Z == 0
sge1101Signed Greater Than or EqualS == O
1111Always
Operation:
if Flags == Condition then
    PC = rA
Flags affected:

BRABRANCH ABSOLUTE

08
935
111000100Location
Format: BRA Location
Purpose: Branch to a set absolute location
Description: The program counter is set to the specified 27-bit location.
Operation: PC = Location
Flags affected:

BRRBRANCH RELATIVE

08
935
111000000Offset
Format: BRR Offset
Purpose: Branch to a relative offset
Description: The 27-bit offset is added to the current program counter.
Operation: PC = PC + Offset
Flags affected:

CCALL CONDITIONAL

05
69
1026
110101ConditionOffset
Format: Ccc Offset
Purpose: Conditional call to an offset
Description: If the specified condition is true then the current program counter + 3 is saved into the RA register and the sign extended offset is added to the current program counter.
The condition table is as follows:
ccValueDescriptionFlag State Checked
n0000Not Equal / Not ZeroZ == 0
e0001Equal / ZeroZ == 1
l0010Less ThanC == 1 AND Z == 0
le0011Less Than or EqualC == 1 OR Z == 1
g0100Greater ThanC == 0 AND Z == 0
ge0101Greater Than or EqualC == 0 OR Z == 1
no0110Not OverflowO == 0
o0111OverflowO == 1
ns1000Not SignedS == 0
s1001SignedS == 1
sl1010Signed Less ThanS != O
sle1011Signed Less Than or EqualS != O OR Z == 1
sg1100Signed Greater ThanS == O AND Z == 0
sge1101Signed Greater Than or EqualS == O
1111Always
Operation:
if Flags == Condition then
    RA = PC + 3
    PC += (signed)Offset
Flags affected:

CAACALL ABSOLUTE

08
935
111001100Location
Format: CAA Location
Purpose: Call to a set absolute location
Description: The current program counter + 4 is stored into RA and the program counter is set to the specified 27-bit location.
Operation:
RA = PC + 4
PC = Location
Flags affected:

CARCALL RELATIVE

08
935
111001000Offset
Format: CAR Offset
Purpose: Call to a relative offset
Description: The current program counter + 4 is stored into RA and the 27-bit offset is added to the current program counter.
Operation:
RA = PC + 4
PC = PC + Offset
Flags affected:

CMCOMPARE

07
812
1317
10111000rArB
Format: CM rA, rB
Purpose: Compare two registers
Description: The 27-bit values in rB is subtracted from rA. The flags are set appropriately.
Operation:
FLAGS = FLAGS & ~0xF
28-bit temp = rA - rB
if temp == 0 then
    ZERO FLAG = 1
if temp & 0x4000000 then
    SIGNED FLAG = 1
if (temp & 0x4000000) != (rA & 0x4000000) then
    OVERFLOW FLAG = 1
if (temp & 0x8000000) then
    CARRY FLAG = 1
Flags affected: Z S O C

CMFCOMPARE FLOATING POINT

07
812
1317
10111010rArB
Format: CMF rA, rB
Purpose: Compare two floating point registers
Description: The 27-bit floating point value in rB is subtracted from the floating point rA. The flags are set appropriately.
Operation:
FLAGS = FLAGS & ~0xF
temp = rA - rB
if temp == 0.0 then
    ZERO FLAG = 1
if temp < 0.0 then
    SIGNED FLAG = 1
if (temp < 0.0) != (rA < 0.0) then
    OVERFLOW FLAG = 1
Flags affected: Z S O

CMFMCOMPARE FLOATING POINT MULTI REG

07
812
1317
10111110rArB
Format: CMFM rA, rB
Purpose: Compare two floating point registers
Description: The 54-bit floating point value in rB is subtracted from the floating point rA. The flags are set appropriately.
Operation:
FLAGS = FLAGS & ~0xF
temp = rA:rA+1 - rB:rB+1
if temp == 0 then
    ZERO FLAG = 1
if temp < 0.0 then
    SIGNED FLAG = 1
if (temp < 0.0) != (rA:rA+1 < 0.0) then
    OVERFLOW FLAG = 1
Flags affected: Z S O

CMICOMPARE IMMEDIATE

07
812
1326
10111001rAImmediate
Format: CMI rA, IMM
Purpose: Compare a register and immediate value
Description: The sign extended immediate value is subtracted from the 27-bit rA. The flags are set appropriately.
Operation:
FLAGS = FLAGS & ~0xF
28-bit temp = rA - (signed)IMM
if temp == 0 then
    ZERO FLAG = 1
if temp & 0x4000000 then
    SIGNED FLAG = 1
if (temp & 0x4000000) != (rA & 0x4000000) then
    OVERFLOW FLAG = 1
if (temp & 0x8000000) then
    CARRY FLAG = 1
Flags affected: Z S O C

CMIMCOMPARE IMMEDIATE MULTI REG

07
812
1326
10111101rAImmediate
Format: CMIM rA, IMM
Purpose: Compare a register and immediate value
Description: The sign extended immediate value is subtracted from the 54-bit rA:rA+1. The flags are set appropriately.
Operation:
FLAGS = FLAGS & ~0xF
55-bit temp = rA:rA+1 - (signed)IMM
if temp == 0 then
    ZERO FLAG = 1
if temp & 0x20000000000000 then
    SIGNED FLAG = 1
if ((temp & 0x20000000000000) !=
        (rA:rA+1 & 0x20000000000000)) then
    OVERFLOW FLAG = 1
if (temp & 0x40000000000000) then
    CARRY FLAG = 1
Flags affected: Z S O C

CMMCOMPARE MULTI REG

07
812
1317
10111100rArB
Format: CMM rA, rB
Purpose: Compare two registers
Description: The 54-bit values in rB:rB+1 is subtracted from rA:rA+1. The flags are set appropriately.
Operation:
FLAGS = FLAGS & ~0xF
55-bit temp = rA:rA+1 - rB:rB+1
if temp == 0 then
    ZERO FLAG = 1
if temp & 0x20000000000000 then
    SIGNED FLAG = 1
if ((temp & 0x20000000000000) !=
        (rA:rA+1 & 0x20000000000000)) then
    OVERFLOW FLAG = 1
if (temp & 0x40000000000000) then
    CARRY FLAG = 1
Flags affected: Z S O C

CRCALL REGISTER CONDITIONAL

05
69
1014
1517
110111ConditionrA000
Format: CRcc rA
Purpose: Conditional call to a register
Description: If the specified condition is true then the current program counter + 2 is saved into the RA register and the program counter is set to the value in rA.
The condition table is as follows:
ccValueDescriptionFlag State Checked
n0000Not Equal / Not ZeroZ == 0
e0001Equal / ZeroZ == 1
l0010Less ThanC == 1 AND Z == 0
le0011Less Than or EqualC == 1 OR Z == 1
g0100Greater ThanC == 0 AND Z == 0
ge0101Greater Than or EqualC == 0 OR Z == 1
no0110Not OverflowO == 0
o0111OverflowO == 1
ns1000Not SignedS == 0
s1001SignedS == 1
sl1010Signed Less ThanS != O
sle1011Signed Less Than or EqualS != O OR Z == 1
sg1100Signed Greater ThanS == O AND Z == 0
sge1101Signed Greater Than or EqualS == O
1111Always
Operation:
if Flags == Condition then
    RA = PC + 2
    PC = rA
Flags affected:

DBRKDEBUG BREAK

017
111111111111111111
Format: DBRK
Purpose: Debug break
Description: A special instruction for emulators to allow forcing a break in the emulation. Normal execution will cause an illegal instruction fault.
Operation:
Flags affected:

DIDISABLE INTERRUPTS

011
1216
17
101000000101rA0
Format: DI rA
Purpose: Disable interrupts based on rA
Description: Disable interrupts based on the mask in rA.
Operation: FLAGS = (FLAGS & 0x7FFE00F) | ((~rA << 4) & 0x1FF0)
Flags affected:

DMTDIRECT MEMORY TRANSFER

06
711
1216
1721
2226
0110100rArBrC00000
Format: DMT rA, rB, rC
Purpose: Directly transfer memory between locations
Description: Directly transfer rC bytes of memory from location pointed to by rB to memory location rA.
Operation:
P = 0
while(P < rC)
    (byte)[rA + P] = (byte)[rB + P]
    P = P + 1
Flags affected:

DVDIVIDE

06
711
1216
1721
2225
26
0001100rArBrC0000UF
Format: DV rA, rB, rC
Purpose: Divide two 27-bit integer registers
Description: The 27-bit value in rB is divided with the 27-bit value in rC, the result is placed in rA.
Operation: rA ← rB / rC
Flags affected: Z C O S

DVFDIVIDE FLOATING POINT

06
711
1216
1721
2225
26
0001101rArBrC0000UF
Format: DVF rA, rB, rC
Purpose: Divide two 27-bit floating point registers
Description: The 27-bit floating point value in rB is divided with the 27-bit floating point value in rC, the result is placed in rA.
Operation: rA ← rB / rC
Flags affected: Z C O S

DVFMDIVIDE FLOATING POINT MULTI REG

06
711
1216
1721
2225
26
0001111rArBrC0000UF
Format: DVFM rA, rB, rC
Purpose: Divide two 54-bit floating point registers
Description: The 54-bit floating point value in rB:rB+1 is divided with the 54-bit floating point value in rC:rC+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 / rC:rC+1
Flags affected: Z C O S

DVIDIVIDE IMMEDIATE

06
711
1216
1723
2425
26
0001100rArBImmediate01UF
Format: DVI rA, rB, IMM
Purpose: Divide a 27-bit integer register by a 7-bit immediate
Description: The 27-bit value in rB is divided with the 7-bit immediate value, the result is placed in rA.
Operation: rA ← rB / IMM
Flags affected: Z C O S

DVIMDIVIDE IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
0001110rArBImmediate01UF
Format: DVIM rA, rB, IMM
Purpose: Divide a 54-bit integer register by a 7-bit immediate
Description: The 54-bit value in rB:rB+1 is divided with the 7-bit immediate value, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 / IMM
Flags affected: Z C O S

DVISDIVIDE IMMEDIATE SIGNED

06
711
1216
1723
2425
26
0001100rArBImmediate11UF
Format: DVIS rA, rB, IMM
Purpose: Divide a signed 27-bit integer register by a signed 7-bit immediate
Description: The signed 27-bit value in rB is divided with the signed 7-bit immediate value, the result is placed in rA.
Operation: rA ← (signed)rB / (signed)IMM
Flags affected: Z C O S

DVISMDIVIDE IMMEDIATE SIGNED MULTI REG

06
711
1216
1723
2425
26
0001110rArBImmediate11UF
Format: DVISM rA, rB, IMM
Purpose: Divide a signed 54-bit integer register by a signed 7-bit immediate
Description: The signed 54-bit value in rB:rB+1 is divided with the signed 7-bit immediate value, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← (signed)rB:rB+1 / (signed)IMM
Flags affected: Z C O S

DVMDIVIDE MULTI REG

06
711
1216
1721
2225
26
0001110rArBrC0000UF
Format: DVM rA, rB, rC
Purpose: Divide two 54-bit integer registers
Description: The 54-bit value in rB:rB+1 is divided with the 54-bit value in rC:rC+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 / rC:rC+1
Flags affected: Z C O S

DVSDIVIDE SIGNED

06
711
1216
1721
2225
26
0001100rArBrC0010UF
Format: DVS rA, rB, rC
Purpose: Divide two signed 27-bit integer registers
Description: The signed 27-bit value in rB is divided with the signed 27-bit value in rC, the result is placed in rA.
Operation: rA ← (signed)rB / (signed)rC
Flags affected: Z C O S

DVSMDIVIDE SIGNED MULTI REG

06
711
1216
1721
2225
26
0001110rArBrC0010UF
Format: DVSM rA, rB, rC
Purpose: Divide two 54-bit integer registers
Description: The 54-bit value in rB:rB+1 is divided with the 54-bit value in rC:rC+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← (signed)rB:rB+1 / (signed)rC:rC+1
Flags affected: Z C O S

EIENABLE INTERRUPTS

011
1216
17
101000000100rA0
Format: EI rA
Purpose: Enable interrupts base on rA
Description: Enable interrupts based on the mask in rA.
Operation: FLAGS = (FLAGS & 0x7FFE00F) | ((rA << 4) & 0x1FF0)
Flags affected:

FTIFLOAT TO INTEGER

08
913
1418
1926
101000101rArB00000000
Format: FTI rA, rB
Purpose: Convert a 27-bit float to integer
Description: The 27-bit float in rB in converted to a 27-bit integer value and stored in rA.
Operation: rA ← int(rB)
Flags affected: Z C O S

FTIMFLOAT TO INTEGER MULTI REG

08
913
1418
1926
101000111rArB00000000
Format: FTIM rA, rB
Purpose: Convert a 54-bit float to integer
Description: The 54-bit float in rB:rB+1 in converted to a 54-bit integer value and stored in rA:rA+1.
Operation: rA:rA+1 ← int(rB:rB+1)
Flags affected: Z C O S

HTHALT

017
101000000011000000
Format: HT
Purpose: Halt the processor
Description: Disables all interrupts and stops the processor from responding to any more instructions.
Operation:
Flags affected:

IRINTERRUPT RETURN

017
101000000001000000
Format: IR
Purpose: Return from an interrupt
Description: Return from an interrupt routine.
Operation:
if Stack_Direction_Flag then
    SP -= 0x63
R0:R31 ← [SP:SP+0x60]
FLAGS ← [SP+0x60:SP+0x63]
if not Stack_Direction_Flag then
    SP += 0x63
Flags affected: Z C O S

ITFINTEGER TO FLOAT

08
913
1418
1926
101000100rArB00000000
Format: ITF rA, rB
Purpose: Convert a 27-bit integer to float
Description: The 27-bit integer in rB in converted to a 27-bit float value and stored in rA.
Operation: rA ← float(rB)
Flags affected: Z C O S

ITFMINTEGER TO FLOAT MULTI REG

08
913
1418
1926
101000110rArB00000000
Format: ITFM rA, rB
Purpose: Convert a 54-bit integer to float
Description: The 54-bit integer in rB:rB+1 in converted to a 54-bit float value and stored in rA:rA+1.
Operation: rA:rA+1 ← float(rB:rB+1)
Flags affected: Z C O S

LDSLOAD SINGLE

06
711
1216
1721
2223
2450
5153
1010100rArBRegister CountAdjust rBMemory Offset000
Format: LDSm rA, [rB + Offset, RegCount]
Purpose: Load a single byte from memory
Description: The value in rB is added to Offset and a single byte per register is loaded into the low 9 bits of rA to rA+RegCount. The top 18 bits are set to zero for each affected register.
m refers to the Adjust RB value which can have the following designations to indicate the mode:
0rB is not adjusted after load
I1rB has the number of bytes read added to the start value after all data is read
D2rB has the number of bytes to read subtracted from the start value after all data is read
Operation:
StartReg = rA
RegCount = RegCount + 1
CurCount = RegCount
Temp = rB
TempPC = PC
if Mode is 2 then
    Temp = Temp - CurCount
MemLocation = (Temp + Offset)
While CurCount is not 0
    Registers[StartReg] = Memory[MemLocation]
    MemLocation += 1
    StartReg = (StartReg + 1) % 32
    CurCount = CurCount - 1
if Mode is 1 then
    rB = rB + RegCount
if Mode is 2 then
    rB = Temp
PC = TempPC
Flags affected:

LDTLOAD TRI

06
711
1216
1721
2223
2450
5153
1010110rArBRegister CountAdjust rBMemory Offset000
Format: LDTm rA, [rB + Offset, RegCount]
Purpose: Load three bytes from memory
Description: The value in rB is added to Offset and three bytes per register are loaded into rA to rA+RegCount.
m refers to the Adjust RB value which can have the following designations to indicate the mode:
0rB is not adjusted after load
I1rB has the number of bytes read added to the start value after all data is read
D2rB has the number of bytes to read subtracted from the start value after all data is read
Operation:
StartReg = rA
RegCount = RegCount + 1
CurCount = RegCount
Temp = rB
TempPC = PC
if Mode is 2 then
    Temp = Temp - (CurCount * 3)
MemLocation = (Temp + Offset)
While CurCount is not 0
    Registers[StartReg] =
        (Memory[MemLocation] << 9) |
        (Memory[(MemLocation + 1)] << 18) |
        Memory[(MemLocation + 2)]
    MemLocation += 3
    StartReg = (StartReg + 1) % 32
    CurCount = CurCount - 1
if Mode is 1 then
    rB = rB + (RegCount * 3)
if Mode is 2 then
    rB = Temp
PC = TempPC
Flags affected:

LDWLOAD WORD

06
711
1216
1721
2223
2450
5153
1010101rArBRegister CountAdjust rBMemory Offset000
Format: LDWm rA, [rB + Offset, RegCount]
Purpose: Load two bytes from memory
Description: The value in rB is added to Offset and two bytes per register are loaded into the low 18 bits of rA to rA+RegCount. The top 9 bits are set to zero for each affected register.
m refers to the Adjust RB value which can have the following designations to indicate the mode:
0rB is not adjusted after load
I1rB has the number of bytes read added to the start value after all data is read
D2rB has the number of bytes to read subtracted from the start value after all data is read
Operation:
StartReg = rA
RegCount = RegCount + 1
CurCount = RegCount
Temp = rB
TempPC = PC
if Mode is 2 then
    Temp = Temp - (CurCount * 2)
MemLocation = (Temp + Offset)
While CurCount is not 0
    Registers[StartReg] =
        (Memory[MemLocation] << 9) | Memory[(MemLocation + 1)]
    MemLocation += 2
    StartReg = (StartReg + 1) % 32
    CurCount = CurCount - 1
if Mode is 1 then
    rB = rB + (RegCount * 2)
if Mode is 2 then
    rB = Temp
PC = TempPC
Flags affected:

MDMODULUS

06
711
1216
1721
2225
26
0010000rArBrC0000UF
Format: MD rA, rB, rC
Purpose: Access the remainder of dividing two 27-bit integer registers
Description: The 27-bit value in rB is divided with the 27-bit value in rC, the remainder of the division is placed in rA.
Operation: rA ← rB % rC
Flags affected: Z C O S

MDFMODULUS FLOATING POINT

06
711
1216
1721
2225
26
0010001rArBrC0000UF
Format: MDF rA, rB, rC
Purpose: Access the remainder of dividing two 27-bit floating point registers
Description: The 27-bit floating point value in rB is divided with the 27-bit floating point value in rC, the remainder of the division is placed in rA.
Operation: rA ← rB % rC
Flags affected: Z C O S

MDFMMODULUS FLOATING POINT MULTI REG

06
711
1216
1721
2225
26
0010011rArBrC0000UF
Format: MDFM rA, rB, rC
Purpose: Access the remainder of dividing two 54-bit floating point registers
Description: The 54-bit floating point value in rB:rB+1 is divided with the 54-bit floating point value in rC:rC+1, the remainder of the division is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 % rC:rC+1
Flags affected: Z C O S

MDIMODULUS IMMEDIATE

06
711
1216
1723
2425
26
0010000rArBImmediate01UF
Format: MDI rA, rB, IMM
Purpose: Access the remainder of dividing a 27-bit integer register by a 7-bit immediate
Description: The 27-bit value in rB is divided with a 7-bit immediate value, the remainder of the division is placed in rA.
Operation: rA ← rB % IMM
Flags affected: Z C O S

MDIMMODULUS IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
0010010rArBImmediate01UF
Format: MDIM rA, rB, IMM
Purpose: Access the remainder of dividing a 54-bit integer register by a 7-bit immediate
Description: The 54-bit value in rB:rB+1 is divided with the 7-bit immediate value, the remainder of the division is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 % IMM
Flags affected: Z C O S

MDISMODULUS IMMEDIATE SIGNED

06
711
1216
1723
2425
26
0010000rArBImmediate11UF
Format: MDIS rA, rB, IMM
Purpose: Access the remainder of dividing a signed 27-bit integer register by a signed 7-bit immediate
Description: The signed 27-bit value in rB is divided with a signed 7-bit immediate value, the remainder of the division is placed in rA.
Operation: rA ← (signed)rB % (signed)IMM
Flags affected: Z C O S

MDISMMODULUS IMMEDIATE SIGNED MULTI REG

06
711
1216
1723
2425
26
0010010rArBImmediate11UF
Format: MDISM rA, rB, IMM
Purpose: Access the remainder of dividing a signed 54-bit integer register by a signed 7-bit immediate
Description: The signed 54-bit value in rB:rB+1 is divided with the signed 7-bit immediate value, the remainder of the division is placed in rA:rA+1.
Operation: rA:rA+1 ← (signed)rB:rB+1 % (signed)IMM
Flags affected: Z C O S

MDMMODULUS MULTI REG

06
711
1216
1721
2225
26
0010010rArBrC0000UF
Format: MDM rA, rB, rC
Purpose: Access the remainder of dividing two 54-bit integer registers
Description: The 54-bit value in rB:rB+1 is divided with the 54-bit value in rC:rC+1, the remainder of the division is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 % rC:rC+1
Flags affected: Z C O S

MDSMODULUS SIGNED

06
711
1216
1721
2225
26
0010000rArBrC0010UF
Format: MDS rA, rB, rC
Purpose: Access the remainder of dividing two signed 27-bit integer registers
Description: The signed 27-bit value in rB is divided with the signed 27-bit value in rC, the remainder of the division is placed in rA.
Operation: rA ← (signed)rB % (signed)rC
Flags affected: Z C O S

MDSMMODULUS SIGNED MULTI REG

06
711
1216
1721
2225
26
0010010rArBrC0010UF
Format: MDSM rA, rB, rC
Purpose: Access the remainder of dividing two signed 54-bit integer registers
Description: The signed 54-bit value in rB:rB+1 is divided with the signed 54-bit value in rC:rC+1, the remainder of the division is placed in rA:rA+1.
Operation: rA:rA+1 ← (signed)rB:rB+1 % (signed)rC:rC+1
Flags affected: Z C O S

MHMOVE HIGH

04
59
1026
10001rAImmediate
Format: MH rA, IMM
Purpose: Move an immediate value to the high bits of a register
Description: The high 17 bits of a 27-bit value in rA is set to the specified immediate value.
Operation: rA ← (IMM << 10) | (rA & 0x3FF)
Flags affected: Z C O S

MLMOVE LOW

04
59
1026
10010rAImmediate
Format: ML rA, IMM
Purpose: Move a 17-bit immediate value to the register
Description: A 27-bit rA is set to the specified 17-bit immediate value. The high bits are zero'd out.
Operation: rA ← IMM
Flags affected: Z C O S

MSMOVE LOW SIGNED

04
59
1026
10011rAImmediate
Format: MS rA, IMM
Purpose: Move a signed 17-bit immediate value to the register
Description: A 27-bit rA is set to the specified signed 17-bit immediate value. The high bits are set based on the signed bit of the immediate value specified.
Operation: rA ← (signed)IMM
Flags affected: Z C O S

MUMULTIPLY

06
711
1216
1721
2225
26
0001000rArBrC0000UF
Format: MU rA, rB, rC
Purpose: Multiply two 27-bit integer registers together
Description: The 27-bit value in rC is multiplied with the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB * rC
Flags affected: Z C O S

MUFMULTIPLY FLOATING POINT

06
711
1216
1721
2225
26
0001001rArBrC0000UF
Format: MUF rA, rB, rC
Purpose: Multiply two 27-bit floating point registers together
Description: The 27-bit floating point value in rC is multiplied with the 27-bit floating point value in rB, the result is placed in rA.
Operation: rA ← rB * rC
Flags affected: Z C O S

MUFMMULTIPLY FLOATING POINT MULTI REG

06
711
1216
1721
2225
26
0001011rArBrC0000UF
Format: MUFM rA, rB, rC
Purpose: Multiply two 54-bit floating point registers together
Description: The 54-bit floating point value in rC:rC+1 is multiplied with the 54-bit floating point value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 * rC:rC+1
Flags affected: Z C O S

MUIMULTIPLY IMMEDIATE

06
711
1216
1723
2425
26
0001000rArBImmediate01UF
Format: MUI rA, rB, IMM
Purpose: Multiply a 27-bit integer register by a 7-bit immediate
Description: The 7-bit immediate value is multiplied with the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB * IMM
Flags affected: Z C O S

MUIMMULTIPLY IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
0001010rArBImmediate01UF
Format: MUIM rA, rB, IMM
Purpose: Multiply a 54-bit integer register by a 7-bit immediate
Description: The 7-bit immediate value is multiplied with the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 * IMM
Flags affected: Z C O S

MUISMULTIPLY IMMEDIATE SIGNED

06
711
1216
1723
2425
26
0001000rArBImmediate11UF
Format: MUIS rA, rB, IMM
Purpose: Multiply a signed 27-bit integer register by a signed 7-bit immediate
Description: The signed 7-bit immediate value is multiplied with the signed 27-bit value in rB, the result is placed in rA.
Operation: rA ← (signed)rB * (signed)IMM
Flags affected: Z C O S

MUISMMULTIPLY IMMEDIATE SIGNED MULTI REG

06
711
1216
1723
2425
26
0001010rArBImmediate11UF
Format: MUISM rA, rB, IMM
Purpose: Multiply a signed 54-bit integer register by a signed 7-bit immediate
Description: The signed 7-bit immediate value is multiplied with the signed 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← (signed)rB:rB+1 * (signed)IMM
Flags affected: Z C O S

MUMMULTIPLY MULTI REG

06
711
1216
1721
2225
26
0001010rArBrC0000UF
Format: MUM rA, rB, rC
Purpose: Multiply two 54-bit integer registers together
Description: The 54-bit value in rC:rC+1 is multiplied with the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 * rC:rC+1
Flags affected: Z C O S

MUSMULTIPLY SIGNED

06
711
1216
1721
2225
26
0001000rArBrC0010UF
Format: MUS rA, rB, rC
Purpose: Multiply two signed 27-bit integer registers together
Description: The signed 27-bit value in rC is multiplied with the signed 27-bit value in rB, the result is placed in rA.
Operation: rA ← (signed)rB * (signed)rC
Flags affected: Z C O S

MUSMMULTIPLY SIGNED MULTI REG

06
711
1216
1721
2225
26
0001010rArBrC0010UF
Format: MUSM rA, rB, rC
Purpose: Multiply two 54-bit integer registers together
Description: The signed 54-bit value in rC:rC+1 is multiplied with the signed 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← (signed)rB:rB+1 * (signed)rC:rC+1
Flags affected: Z C O S

NGNEGATE

08
913
1418
1925
26
101001100rArB0000000UF
Format: NG rA, rB
Purpose: Negate a 27-bit register
Description: Negate the 27-bit rB register value and store the result in rA.
Operation: rA ← -rB
Flags affected: Z C O S

NGFNEGATE FLOATING POINT

08
913
1418
1925
26
101001101rArB0000000UF
Format: NGF rA, rB
Purpose: Negate a 27-bit floating-point register
Description: Negate the 27-bit rB floating-point register value and store the result in rA.
Operation: rA ← -rB
Flags affected: Z S

NGFMNEGATE FLOATING POINT MULTI REG

08
913
1418
1925
26
101001111rArB0000000UF
Format: NGFM rA, rB
Purpose: Negate a 54-bit floating-point register
Description: Negate the 54-bit rB:rB+1 floating-point register value and store the result in rA:rA+1.
Operation: rA:rA+1 ← -rB:rB+1
Flags affected: Z S

NGMNEGATE MULTI REG

08
913
1418
1925
26
101001110rArB0000000UF
Format: NGM rA, rB
Purpose: Negate a 54-bit register
Description: Negate the 54-bit rB:rB+1 register value and store the result in rA:rA+1.
Operation: rA:rA+1 ← -rB:rB+1
Flags affected: Z C O S

NTNOT

08
913
1418
1925
26
101001100rArB0100000UF
Format: NT rA, rB
Purpose: Bit test a 27-bit register
Description: Test all bits of the 27-bit rB register value. If any bits are set then rA is set to 0. If all bits are off then rA is set to 1.
Operation: rA ← !rB
Flags affected: Z C O S

NTMNOT MULTI REG

08
913
1418
1925
26
101001110rArB0100000UF
Format: NTM rA, rB
Purpose: Bit test a 54-bit register
Description: Test all bits of the 54-bit rB:rB+1 register value. If any bits are set then rA:rA+1 is set to 0. If all bits are off then rA:rA+1 is set to 1.
Operation: rA:rA+1 ← !rB:rB+1
Flags affected: Z C O S

OROR

06
711
1216
1721
2225
26
0011000rArBrC0000UF
Format: OR rA, rB, rC
Purpose: Bit-wise OR two 27-bit integer registers together
Description: The 27-bit value in rC is bit-wise OR to the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB | rC
Flags affected: Z C O S

ORIOR IMMEDIATE

06
711
1216
1723
2425
26
0011000rArBImmediate01UF
Format: ORI rA, rB, IMM
Purpose: Bit-wise OR a 27-bit integer register and 7-bit immediate together
Description: The 7-bit immediate value is bit-wise OR to the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB | IMM
Flags affected: Z C O S

ORMOR MULTI REG

06
711
1216
1721
2225
26
0011010rArBrC0000UF
Format: ORM rA, rB, rC
Purpose: Bit-wise OR two 54-bit integer registers together
Description: The 54-bit value in rC:rC+1 is bit-wise OR to the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 | rC:rC+1
Flags affected: Z C O S

RERETURN

017
101000000000000000
Format: RE
Purpose: To return from a call
Description: To return from a call.
Operation: PC ← RETADDR
Flags affected:

RFREAD FLAGS

011
1216
17
101000001100rA0
Format: RF rA
Purpose: Read flags into the rA register
Description: Set rA to the value in the flag register.
Operation: rA = FLAGS
Flags affected:

RLROTATE LEFT

06
711
1216
1721
2225
26
0110000rArBrC0000UF
Format: RL rA, rB, rC
Purpose: Rotate left a 27-bit integer
Description: The 27-bit value in rB is left rotated the number of bits specified in rC. The result is placed in rA.
Operation: rA ← (rB << rC) | (rB >> (27-rC))
Flags affected: Z C O S

RLIROTATE LEFT IMMEDIATE

06
711
1216
1723
2425
26
1000000rArBImmediate00UF
Format: RLI rA, rB, IMM
Purpose: Rotate left a 27-bit integer by a 7-bit immediate value
Description: The 27-bit value in rB is left rotated by the 7-bit immediate value. The result is placed in rA.
Operation: rA ← (rB << IMM) | (rB >> (27-IMM))
Flags affected: Z C O S

RLIMROTATE LEFT IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
1000010rArBImmediate00UF
Format: RLIM rA, rB, IMM
Purpose: Rotate left a 54-bit integer by a 7-bit immediate value
Description: The 54-bit value in rB:rB+1 is left rotated by the 7-bit immediate value. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← (rB:rB+1 << IMM) | (rB:rB+1 >> (54-IMM))
Flags affected: Z C O S

RLMROTATE LEFT MULTI REG

06
711
1216
1721
2225
26
0110010rArBrC0000UF
Format: RLM rA, rB, rC
Purpose: Rotate left a 54-bit integer
Description: The 54-bit value in rB:rB+1 is left rotated the number of bits specified in rC. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← (rB:rB+1 << rC) | (rB:rB+1 >> (54-rC))
Flags affected: Z C O S

RMPREAD MEMORY PROTECTION

06
711
1216
1726
1010010rArB0000000000
Format: RMP rA, rB
Purpose: Read the memory protections for a page of memory
Description: rA is set to the page protection flags of the pages of the specified memory range starting at the memory location specified by rA and moving forward rB pages. A set zero flag indicates success, upon failure rA holds the error reason. Every 2 bits indicates the memory protection state of a page. Only 13 page statuses can be returned at a time.
Errors:
0Memory start is not page aligned
1Too many pages specified

Flags:
0No access
1Read
2Read/Write
3Read/Execute
Operation:
rA ←
        Memory_Page_Flags[rA]:Memory_Page_Flags[rA+(rB*1024)]
Flags affected: Z

RNDRANDOM

08
913
1425
26
101001100rA000001100000UF
Format: RND rA
Purpose: Generate a random value into rA
Description: A random value is placed into the 27-bit rA register.
Operation: rA ← <random value>
Flags affected: Z C O S

RNDMRANDOM MULTI REG

08
913
1425
26
101001110rA000001100000UF
Format: RNDM rA
Purpose: Generate a random value into rA:rA+1
Description: A random value is generated and placed into the 54-bit rA:rA+1 register.
Operation: rA:rA+1 ← <random value>
Flags affected: Z C O S

RRROTATE RIGHT

06
711
1216
1721
2225
26
0110001rArBrC0000UF
Format: RR rA, rB, rC
Purpose: Rotate right a 27-bit integer
Description: The 27-bit value in rB is right rotated the number of bits specified in rC. The result is placed in rA.
Operation: rA ← (rB >> rC) | (rB << (27-rC))
Flags affected: Z C O S

RRIROTATE RIGHT IMMEDIATE

06
711
1216
1723
2425
26
1000001rArBImmediate00UF
Format: RRI rA, rB, IMM
Purpose: Rotate right a 27-bit integer by a 7-bit immediate value
Description: The 27-bit value in rB is right rotated by the 7-bit immediate value. The result is placed in rA.
Operation: rA ← (rB >> IMM) | (rB << (27-IMM))
Flags affected: Z C O S

RRIMROTATE RIGHT IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
1000011rArBImmediate00UF
Format: RRIM rA, rB, rC
Purpose: Rotate right a 54-bit integer by an immediate value
Description: The 54-bit value in rB:rB+1 is right rotated by the 7-bit immediate value. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← (rB:rB+1 >> IMM) | (rB:rB+1 << (54-IMM))
Flags affected: Z C O S

RRMROTATE RIGHT MULTI REG

06
711
1216
1721
2225
26
0110011rArBrC0000UF
Format: RRM rA, rB, rC
Purpose: Rotate right a 54-bit integer
Description: The 54-bit value in rB:rB+1 is right rotated the number of bits specified in rC. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← (rB:rB+1 >> rC) | (rB:rB+1 << (54-rC))
Flags affected: Z C O S

SASHIFT ARITHEMETIC RIGHT

06
711
1216
1721
2225
26
0101101rArBrC0000UF
Format: SA rA, rB, rC
Purpose: Shift right arithmetic a 27-bit integer
Description: The 27-bit value in rB is right arithmetic shifted the number of bits specified in rC. The result is placed in rA.
Operation: rA ← (signed)rB >> rC
Flags affected: Z C O S

SAISHIFT ARITHEMETIC RIGHT IMMEDIATE

06
711
1216
1723
2425
26
0111101rArBImmediate00UF
Format: SAI rA, rB, IMM
Purpose: Shift right arithmetic a 27-bit integer by a 7-bit immediate value
Description: The 27-bit value in rB is right arithmetic shifted by the 7-bit immediate value. The result is placed in rA.
Operation: rA ← (signed)rB >> IMM
Flags affected: Z C O S

SAIMSHIFT ARITHEMETIC RIGHT IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
0111111rArBImmediate00UF
Format: SAIM rA, rB, IMM
Purpose: Shift right arithmetic a 54-bit integer by a 7-bit immediate value
Description: The 54-bit value in rB:rB+1 is right arithmetic shifted by the 7-bit immediate value. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← (signed)rB:rB+1 >> IMM
Flags affected: Z C O S

SAMSHIFT ARITHEMETIC RIGHT MULTI REG

06
711
1216
1721
2225
26
0101111rArBrC0000UF
Format: SAM rA, rB, rC
Purpose: Shift right arithmetic a 54-bit integer
Description: The 54-bit value in rB:rB+1 is right arithmetic shifted the number of bits specified in rC. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← (signed)rB:rB+1 >> rC
Flags affected: Z C O S

SBSUBTRACT

06
711
1216
1721
2225
26
0000100rArBrC0000UF
Format: SB rA, rB, rC
Purpose: Subtract two 27-bit integer registers from each other
Description: The 27-bit value in rC is subtracted from the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB - rC
Flags affected: Z C O S

SBCSUBTRACT WITH CARRY

06
711
1216
1721
2225
26
0100100rArBrC0000UF
Format: SBC rA, rB, rC
Purpose: Subtract two 27-bit integer registers from each other including the carry bit
Description: The 27-bit value in rC is subtracted from the 27-bit value in rB, the carry bit from any previous operation is subtracted from the result. The result is placed in rA.
Operation: rA ← rB - rC - Carry_Bit
Flags affected: Z C O S

SBCISUBTRACT IMMEDIATE WITH CARRY

06
711
1216
1723
2425
26
0100100rArBImmediate01UF
Format: SBCI rA, rB, IMM
Purpose: Subtract a 7-bit immediate from a 27-bit integer register including the carry bit
Description: The 7-bit immediate value is subtracted from the 27-bit value in rB, the carry bit from any previous operation is subtracted from the result. The result is placed in rA.
Operation: rA ← rB - IMM - Carry_Bit
Flags affected: Z C O S

SBCIMSUBTRACT IMMEDIATE MULTI REG WITH CARRY

06
711
1216
1723
2425
26
0100110rArBImmediate01UF
Format: SBCIM rA, rB, IMM
Purpose: Subtract a 7-bit immediate from a 54-bit integer register including the carry bit
Description: The 7-bit immediate value is subtracted from the 54-bit value in rB:rB+1, the carry bit from any previous operation is subtracted from the result. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 - IMM - Carry_Bit
Flags affected: Z C O S

SBCMSUBTRACT MULTI REG WITH CARRY

06
711
1216
1721
2225
26
0100110rArBrC0000UF
Format: SBCM rA, rB, rC
Purpose: Subtracted two 54-bit integer registers from each other including the carry bit
Description: The 54-bit value in rC:rC+1 is subtracted from the 54-bit value in rB:rB+1, the carry bit from any previous operation is subtracted from the result. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 - rC:rC+1 - Carry_Bit
Flags affected: Z C O S

SBFSUBTRACT FLOATING POINT

06
711
1216
1721
2225
26
0000101rArBrC0000UF
Format: SBF rA, rB, rC
Purpose: Subtract two 27-bit floating point registers from each other
Description: The 27-bit floating point value in rC is subtracted from to the 27-bit floating point value in rB, the result is placed in rA.
Operation: rA ← rB - rC
Flags affected: Z C O S

SBFMSUBTRACT FLOATING POINT MULTI REG

06
711
1216
1721
2225
26
0000111rArBrC0000UF
Format: SBFM rA, rB, rC
Purpose: Subtract two 54-bit floating point registers from each other
Description: The 54-bit floating point value in rC:rC+1 is subtracted from the 54-bit floating point value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 - rC:rC+1
Flags affected: Z C O S

SBISUBTRACT IMMEDIATE

06
711
1216
1723
2425
26
0000100rArBImmediate01UF
Format: SBI rA, rB, IMM
Purpose: Subtract a 7-bit immediate value from a 27-bit integer register
Description: The 7-bit immediate value is subtracted from the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB - IMM
Flags affected: Z C O S

SBIMSUBTRACT IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
0000110rArBImmediate01UF
Format: SBIM rA, rB, IMM
Purpose: Subtract a 7-bit immediate value from a 54-bit integer register
Description: The 7-bit immediate value is subtracted from the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 - IMM
Flags affected: Z C O S

SBMSUBTRACT MULTI REG

06
711
1216
1721
2225
26
0000110rArBrC0000UF
Format: SBM rA, rB, rC
Purpose: Subtracted two 54-bit integer registers from each other
Description: The 54-bit value in rC:rC+1 is subtracted from the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 - rC:rC+1
Flags affected: Z C O S

SESSIGN EXTEND SINGLE

011
1216
1721
2226
101000000111rArB00000
Format: SES rA, rB
Purpose: Sign extend from a byte
Description: Sign extend a single byte from register rB into the 27-bit rA.
Operation: rA ← (signed)(rB << 18) >> 18
Flags affected: Z C O S

SEWSIGN EXTEND WORD

011
1216
1721
2226
101000001000rArB00000
Format: SEW rA, rB
Purpose: Sign extend from two bytes
Description: Sign extend a 18-bit value from register rB into the 27-bit rA.
Operation: rA ← (signed)(rB << 9) >> 9
Flags affected: Z C O S

SFSET FLAGS

011
1216
17
101000001011rA0
Format: SF rA
Purpose: Set flag register to rA
Description: Set the flag register to the value in rA.
Operation: FLAGS = rA & 0x7FFFFFF
Flags affected: Z C O S

SLSHIFT LEFT

06
711
1216
1721
2225
26
0101000rArBrC0000UF
Format: SL rA, rB, rC
Purpose: Shift left a 27-bit integer
Description: The 27-bit value in rB is left shifted the number of bits specified in rC. The result is placed in rA.
Operation: rA ← rB << rC
Flags affected: Z C O S

SLISHIFT LEFT IMMEDIATE

06
711
1216
1723
2425
26
0111000rArBImmediate00UF
Format: SLI rA, rB, IMM
Purpose: Shift left a 27-bit integer by a 7-bit immediate value
Description: The 27-bit value in rB is left shifted by the 7-bit immediate value. The result is placed in rA.
Operation: rA ← rB << IMM
Flags affected: Z C O S

SLIMSHIFT LEFT IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
0111010rArBImmediate00UF
Format: SLIM rA, rB, IMM
Purpose: Shift left a 54-bit integer by a 7-bit immediate value
Description: The 54-bit value in rB is left shifted by the 7-bit immediate value. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 << IMM
Flags affected: Z C O S

SLMSHIFT LEFT MULTI REG

06
711
1216
1721
2225
26
0101010rArBrC0000UF
Format: SLM rA, rB, rC
Purpose: Shift left a 54-bit integer
Description: The 54-bit value in rB:rB+1 is left shifted the number of bits specified in rC. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 << rC
Flags affected: Z C O S

SMPSET MEMORY PROTECTION

06
711
1216
17
1819
2026
1010010rArB1Memory Flags0000000
Format: SMP rA, rB, FLAGS
Purpose: Set the memory protections for a range of pages of memory
Description: Memory starting at a page boundary specified by rA has its page protection flags set to FLAGS for rB pages. A set zero flag indicates success. Upon failure rA holds the error reason.
Errors:
0Memory start is not page aligned
1Too many pages specified

Flags:
0No access
1Read
2Read/Write
3Read/Execute
Operation:
Flags affected: Z

SRSHIFT RIGHT

06
711
1216
1721
2225
26
0101001rArBrC0000UF
Format: SR rA, rB, rC
Purpose: Shift right a 27-bit integer
Description: The 27-bit value in rB is right shifted the number of bits specified in rC. The result is placed in rA.
Operation: rA ← rB >> rC
Flags affected: Z C O S

SRISHIFT RIGHT IMMEDIATE

06
711
1216
1723
2425
26
0111001rArBImmediate00UF
Format: SRI rA, rB, IMM
Purpose: Shift right a 27-bit integer by a 7-bit immediate value
Description: The 27-bit value in rB is right shifted by the 7-bit immediate value. The result is placed in rA.
Operation: rA ← rB >> IMM
Flags affected: Z C O S

SRIMSHIFT RIGHT IMMEDIATE MULTI REG

06
711
1216
1723
2425
26
0111011rArBImmediate00UF
Format: SRIM rA, rB, IMM
Purpose: Shift right a 54-bit integer by a 7-bit immediate value
Description: The 54-bit value in rB:rB+1 is right shifted by the 7-bit immediate value. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 >> IMM
Flags affected: Z C O S

SRMSHIFT RIGHT MULTI REG

06
711
1216
1721
2225
26
0101011rArBrC0000UF
Format: SRM rA, rB, rC
Purpose: Shift right a 54-bit integer
Description: The 54-bit value in rB:rB+1 is right shifted the number of bits specified in rC. The result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 >> rC
Flags affected: Z C O S

STSSTORE SINGLE

06
711
1216
1721
2223
2450
5153
1011000rArBRegister CountAdjust rBMemory Offset000
Format: STSm rA, [rB + Offset, RegCount]
Purpose: Store a single byte into memory
Description: The value in rB is added to Offset and a single byte per register is stored from the low 9 bits of each register from rA to rA+RegCount. m refers to the Adjust RB value which can have the following designations to indicate the mode:
0rB is not adjusted after store
I1rB has the number of bytes written added to the start value after all data is written
D2rB has the number of bytes to write subtracted from the start value after all data is written
Operation:
StartReg = rA
RegCount = RegCount + 1
CurCount = RegCount
Temp = rB
if Mode is 2 then
    Temp = Temp - CurCount
MemLocation = (Temp + Offset)
While CurCount is not 0
    Memory[MemLocation] = Registers[StartReg] & 0x1ff
    MemLocation += 1
    StartReg = (StartReg + 1) % 32
    CurCount = CurCount - 1
if Mode is 1 then
    rB = rB + RegCount
if Mode is 2 then
    rB = Temp
Flags affected:

STTSTORE TRI

06
711
1216
1721
2223
2450
5153
1011010rArBRegister CountAdjust rBMemory Offset000
Format: STTm rA, [rB + Offset, RegCount]
Purpose: Store three bytes into memory
Description: The value in rB is added to Offset and a three bytes per register are stored for each register from rA to rA+RegCount. m refers to the Adjust RB value which can have the following designations to indicate the mode:
0rB is not adjusted after store
I1rB has the number of bytes written added to the start value after all data is written
D2rB has the number of bytes to write subtracted from the start value after all data is written
Operation:
StartReg = rA
RegCount = RegCount + 1
CurCount = RegCount
Temp = rB
if Mode is 2 then
    Temp = Temp - (CurCount * 3)
MemLocation = (Temp + Offset)
While CurCount is not 0
    Memory[MemLocation] =
        (Registers[StartReg] >> 9) & 0x1ff
    MemLocation += 1
    Memory[MemLocation] =
        (Registers[StartReg] >> 18) & 0x1ff
    MemLocation += 1
    Memory[MemLocation] =
        Registers[StartReg] &    0x1ff
    MemLocation += 1
    StartReg = (StartReg + 1) % 32
    CurCount = CurCount - 1
if Mode is 1 then
    rB = rB + (RegCount * 3)
if Mode is 2 then
    rB = Temp
Flags affected:

STWSTORE WORD

06
711
1216
1721
2223
2450
5153
1011001rArBRegister CountAdjust rBMemory Offset000
Format: STWm rA, [rB + Offset, RegCount]
Purpose: Store two bytes into memory
Description: The value in rB is added to Offset and a two bytes per register are stored from the low 18 bits of each register from rA to rA+RegCount. m refers to the Adjust RB value which can have the following designations to indicate the mode:
0rB is not adjusted after store
I1rB has the number of bytes written added to the start value after all data is written
D2rB has the number of bytes to write subtracted from the start value after all data is written
Operation:
StartReg = rA
RegCount = RegCount + 1
CurCount = RegCount
Temp = rB
if Mode is 2 then
    Temp = Temp - (CurCount * 2)
MemLocation = (Temp + Offset)
While CurCount is not 0
    Memory[MemLocation] = (Registers[StartReg] >> 9) & 0x1ff
    MemLocation = (MemLocation + 1)
    Memory[MemLocation] = Registers[StartReg] & 0x1ff
    MemLocation = (MemLocation + 1)
    StartReg = (StartReg + 1) % 32
    CurCount = CurCount - 1
if Mode is 1 then
    rB = rB + (RegCount * 2)
if Mode is 2 then
    rB = Temp
Flags affected:

WTWAIT

017
101000000010000000
Format: WT
Purpose: Wait for interrupt
Description: Pauses the processor until an interrupt fires.
Operation:
Flags affected:

XRXOR

06
711
1216
1721
2225
26
0011100rArBrC0000UF
Format: XR rA, rB, rC
Purpose: Bit-wise eXclusive OR two 27-bit integer registers together
Description: The 27-bit value in rC is bit-wise eXclusive OR to the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB ^ rC
Flags affected: Z C O S

XRIXOR IMMEDIATE

06
711
1216
1723
2425
26
0011100rArBImmediate01UF
Format: XRI rA, rB, IMM
Purpose: Bit-wise Exclusive OR a 27-bit integer register and 7-bit immediate together
Description: The 7-bit immediate value is bit-wise Exclusive OR to the 27-bit value in rB, the result is placed in rA.
Operation: rA ← rB ^ IMM
Flags affected: Z C O S

XRMXOR MULTI REG

06
711
1216
1721
2225
26
0011110rArBrC0000UF
Format: XRM rA, rB, rC
Purpose: Bit-wise eXclusive OR two 54-bit integer registers together
Description: The 54-bit value in rC:rC+1 is bit-wise eXclusive OR to the 54-bit value in rB:rB+1, the result is placed in rA:rA+1.
Operation: rA:rA+1 ← rB:rB+1 ^ rC:rC+1
Flags affected: Z C O S

ZESZERO EXTEND SINGLE

011
1216
1721
2226
101000001001rArB00000
Format: ZES rA, rB
Purpose: Zero extend from a byte
Description: Zero extend a single byte from register rB into the 27-bit rA.
Operation: rA ← rB & 0x00001FF
Flags affected: Z C O S

ZEWZERO EXTEND WORD

011
1216
1721
2226
101000001010rArB00000
Format: ZEW rA, rB
Purpose: Zero extend from two bytes
Description: Zero extend a 18-bit value from register rB into the 27-bit rA.
Operation: rA ← rB & 0x003FFFF
Flags affected: Z C O S